package javacode.chapter07.homework;

public class Homework07 {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "阿黄";
        dog.age = 5;
        dog.color = "yellow";
        dog.show();
    }
}


/**
 * 设计一个Dog类，有名字、颜色和年龄属性，
 * 定义输出方法show()显示其信息，
 * 并创建对象，进行测试、【提示this.属性】
 */

class Dog{
    String name;
    String color;
    int age;

    public Dog() {
    }

    public Dog(String name, String color, int age){
        this.name = name;
        this.color = color;
        this.age = age;
    }

    void show(){
        System.out.println("这个狗的名字为："+name+"，颜色为："+color+",年龄有："+age+"岁");
    }
}